package org.projetjava.presentation;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;

import org.projetjava.metier.model.Poi;

public class AffichageDescriptionPoi implements ActionListener  {
	
	private Poi poi;
	private DescriptionPoi descriptionPoi;

	public AffichageDescriptionPoi(Poi poi, DescriptionPoi descriptionPoi)
	{
		this.poi = poi;
		this.descriptionPoi = descriptionPoi;
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		descriptionPoi.getPanNom().setBorder(BorderFactory.createTitledBorder(poi.getLibelle()));
		descriptionPoi.getNomLabel().setText(poi.getDescription());
		descriptionPoi.chargement(poi, 1);
		descriptionPoi.setPositionHistorique(descriptionPoi.getListHistorique().size() - 1);
	}

}
